package org.hongrun.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.hongrun.back.SentinelFallback;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public  class SentinelController {
    @GetMapping("/rt")
    @SentinelResource(value = "getRtResource", fallback = "rtFallback",
            fallbackClass = SentinelFallback. class)
    public String Rt(){
        System.out.println("熔断进入");
        try {
        Thread.sleep (2000);
    } catch (InterruptedException e)

    {
        throw new RuntimeException(e);
    }
        return"慢调用熔断进入";}




}